/****
 * Copyright (C) 2006 dNux Team
 *                                                            ****
 * This program is free software; you can redistribute it and/or *
 * modify under the terms of the GNU General Public License as   *
 * published by the Free Software Foundation;                    *
 * either version 2 of the License.                              *
 *                                                               *
 * This program is distributed in the hope that it will be       *
 * useful, but WITHOUT ANY WARRANTY; without even the implied    *
 * warranty of without even the implied waranty of               *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.          *
 * See the GNU General Public License for more details.          *
 *                                                               *
 * You should have received a copy of the                        *
 * GNU General Public License                                    *
 * along with this program; if not, write to the                 *
 * Free Software Foundation, Inc.,                               *
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. *
 *                                                               *
 ****                                                         ****/

void error_func1(d_error_t **error)
{
  d_error("test", "is detected?");
}

void error_detect(d_check_t *check)
{
  d_error_t *error=NULL;
  error_func1(&error);
  if (error) {
    d_check_add(check, D_CHECK_OK, "error::detect => error is detected !");
    d_error_free(&error);
  } else {
    d_check_add(check, D_CHECK_ERROR, "error::detect => error is not detected.");
  }
}

void
error_tests(d_check_t *check)
{
  fprintf(stdout, ">> error_tests <<\n");
  error_detect(check);
  fprintf(stdout, "\n");
}
